package com.hangzhou.welbeing.welbeinginstrument.activity;

import android.app.Activity;
import android.graphics.Bitmap;
import android.os.Bundle;
import android.view.View;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.ImageView;
import android.widget.ProgressBar;
import android.widget.TextView;

import com.hangzhou.welbeing.welbeinginstrument.R;
import com.hangzhou.welbeing.welbeinginstrument.config.RBConstants;
import com.hangzhou.welbeing.welbeinginstrument.utils.Utils;

import butterknife.Bind;
import butterknife.ButterKnife;

/**
 * 时间 2017 年 09 月 27.
 * 作者 Administrator  刘传华
 * 公司 杭州惟君医疗科技有限公司
 * 包名 com.hangzhou.welbeing.pregnant.welbeing_pregnant.fragement
 * 工程名 welbeing_pregnant
 */
public class NewDateAritclePagerActivity extends Activity {
    @Bind(R.id.activity_new_date_aritcle_page_iv_return)
    ImageView activityNewDateAritclePageIvReturn;
    @Bind(R.id.activity_new_date_aritcle_page_tv_titiles)
    TextView activityNewDateAritclePageTvTitiles;
    @Bind(R.id.activity_new_date_aritcle_page_iv_shared)
    ImageView activityNewDateAritclePageIvShared;
    @Bind(R.id.activity_new_date_aritcle_page_ProgressBar)
    ProgressBar activityNewDateAritclePageProgressBar;
    @Bind(R.id.activity_new_date_aritcle_page_wb_content)
    WebView activityNewDateAritclePageWbContent;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_new_date_aritcle_page);
        ButterKnife.bind(this);

        Utils.setStatusBar(this,false,false);
        Utils.setStatusTextColor(true,this);
        String srtcle_id =  getIntent().getStringExtra("srtcle_id");
        activityNewDateAritclePageWbContent.setWebViewClient(new WebViewClient(){
            @Override
            public void onPageStarted(WebView view, String url, Bitmap favicon) {
                super.onPageStarted(view, url, favicon);}

            @Override
            public void onPageFinished(WebView view, String url) {
                super.onPageFinished(view, url);
                activityNewDateAritclePageProgressBar.setVisibility(View.GONE);
            }
        });
        activityNewDateAritclePageWbContent.loadUrl(RBConstants.SERVER_URL+RBConstants.NEW_DETAILS_PAGER+srtcle_id);
    }
}
